{% extends "base.html" %}

{% block baslik %}
    Login
{% endblock %}

{% block icerik %}

<div style="position : relative;top:20px;">
    <header>
        <h2>Login Page</h2>
    </header>

    {% if user.is_authenticated %}
      You are already logged in.
    {% else %}

    <section>
        {% if form.errors %}
            <p>Your username and password didn't match, please try again.</p>
        {% endif %}
        <form method="post" action=".">
            {% csrf_token %}
            <table>
            <tr>
                <td>{{ form.username.label_tag }}</td>
                <td>{{ form.username }}</td>
            </tr>
            <tr>
                <td>{{ form.password.label_tag }}</td>
                <td>{{ form.password }}</td>
            </tr>
            </table>

            {% if next %}
                <input type="hidden" name="next" value="{{ next }}" />
            {% else %}
                <input type="hidden" name="next" value="/main/" />
            {% endif %}
                <input type="submit" value="login" />
        </form>
    </section>

    {% endif %}
<div>
{% endblock %}

